/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package demo06;

/**
 *
 * @author Administrator
 */
import java.io.*;
class writeFileDemo {

    public static void main(String args[]) throws Exception {
        File file = new File("text.txt");;
        FileOutputStream f = new FileOutputStream(file, true);
        PrintWriter p = new PrintWriter(f, true);
        p.println("hello");
        System.out.println("已经成功向文件添加了一个数据");

    }
}
